home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
mxcode
/
sbprocss
/
process.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-01-14
|
844b
|
32 lines
program Process; {$R-} {$S-} {$Q-}
uses
SBSample,
CRT;
procedure ClipSample(var Sample: integer);
begin
if Sample > 127 then Sample := 127;
if Sample < -128 then Sample := -128;
end;
procedure ProcessSample(var Sample: byte);
{Make sure that you clip the sample so it stays in the proper range}
var
Temp: integer;
begin
Temp := Sample-128;
{Process the sample here}
Temp := Temp;
ClipSample(Temp);
Sample := Temp+128;
end;
var
Sample: byte;
begin
ResetDSP;
repeat
Sample := GetSample;
ProcessSample(Sample);
OutputSample(Sample);
until KeyPressed; ReadKey;
end.